package com.service.impl;

import com.dao.BookingDao;
import com.dao.impl.BookingDaoImpl;
import com.pojo.Booking;
import com.service.BookingService;

import java.util.List;

public class BookingServiceImpl implements BookingService {
    BookingDao bookingDao = new BookingDaoImpl();

    @Override
    public List<Booking> findAllBooking() {
        return bookingDao.getAllBooking();
    }

    @Override
    public int addBooking(Booking booking) {
        return bookingDao.addBooking(booking);
    }

    @Override
    public int updateBooking(Booking booking) {
        return bookingDao.updateBooking(booking);
    }

    @Override
    public boolean isBookingExist(Booking booking) {
        if (bookingDao.getBookingCount(booking) > 0){
            return true;
        }
        return false;
    }
}
